/* Ejercicio 2.23
   ejer2_23.c */
#include <stdio.h>

/* funcion main, el programa inicia aca */
int main( void )
{
    int n1, n2, n3, n4, n5;
    int smallest, largest;

    printf( "Enter 5 integers: " );
    scanf( "%d%d%d%d%d", &n1, &n2, &n3, &n4, &n5 );

    smallest = n1;

    if ( n2 < smallest ) {
        smallest = n2;
    }

    if ( n3 < smallest ) {
        smallest = n3;
    }

    if ( n4 < smallest ) {
        smallest = n4;
    }

    if ( n5 < smallest ) {
        smallest = n5;
    }

    largest = n1;

    if ( n2 > largest ) {
        largest = n2;
    }

    if ( n3 > largest ) {
        largest = n3;
    }

    if ( n4 > largest ) {
        largest = n4;
    }

    if ( n5 > largest ) {
        largest = n5;
    }

    printf( "The smallest number is: %d\n", smallest );
    printf( "The largest number is: %d\n", largest );
    return 0;
} /* fin de la funcion main */
